package com.fwtai.api.controller;

import com.fwtai.config.ConfigFile;
import com.fwtai.service.api.ApiDictService;
import com.fwtai.tool.ToolClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * 数据字典
 * @作者 田应平
 * @版本 v1.0
 * @创建时间 2021年7月20日 16:15:12
 * @QQ号码 444141300
 * @Email service@yinlz.com
 * @官网 <url>http://www.fwtai.com</url>
*/
@Api(tags = "数据字典",description = "token不填")
@RestController
@RequestMapping(ConfigFile.guest_v10 + "dict")
public class DictController{

  @Resource
  private ApiDictService apiDictService;

  @ApiOperation(value = "通过父级id获取数据字典", notes = "获取数据字典")
  @ApiImplicitParams({
    @ApiImplicitParam(name = "pid", value = "父id", dataType = "String", paramType = "query", required = true)
  })
  @GetMapping("/getDictData")
  public void getDictData(final String pid,final HttpServletResponse response){
    ToolClient.responseJson(apiDictService.getDictData(pid),response);
  }

  @ApiOperation(value = "职务类型", notes = "获取职务类型")
  @GetMapping("/getPosttype")
  public void getPosttype(final HttpServletResponse response){
    ToolClient.responseJson(apiDictService.getPosttype(),response);
  }

  @ApiOperation(value = "获取选择指定国家", notes = "选择指定国家")
  @GetMapping("/getCountry")
  public void getCountry(final Long pid,final HttpServletResponse response){
    ToolClient.responseJson(apiDictService.getCountry(pid),response);
  }

  @ApiOperation(value = "企业类型", notes = "获取企业类型")
  @GetMapping("/getEnterpriseType")
  public void getEnterprise(final HttpServletResponse response){
    ToolClient.responseJson(apiDictService.getEnterpriseType(),response);
  }

  @ApiOperation(value = "行业类型", notes = "获取企业行业类型,传值时传的是kid")
  @GetMapping("/getVocationType")
  public void getVocationType(final HttpServletResponse response){
    ToolClient.responseJson(apiDictService.getVocationType(),response);
  }

  @ApiOperation(value = "合伙类型", notes = "获取申请合伙人的合伙类型")
  @GetMapping("/getPartnerType")
  public void getPartnerType(final HttpServletResponse response){
    ToolClient.responseJson(apiDictService.getPartnerType(),response);
  }
}